import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_record_entity.dart';

EmergencyRecordEntity $EmergencyRecordEntityFromJson(Map<String, dynamic> json) {
  final EmergencyRecordEntity emergencyRecordEntity = EmergencyRecordEntity();
  final String? amendmentDate = jsonConvert.convert<String>(json['amendmentDate']);
  if (amendmentDate != null) {
    emergencyRecordEntity.amendmentDate = amendmentDate;
  }
  final String? amendmentInfo = jsonConvert.convert<String>(json['amendmentInfo']);
  if (amendmentInfo != null) {
    emergencyRecordEntity.amendmentInfo = amendmentInfo;
  }
  final String? amendmentReason = jsonConvert.convert<String>(json['amendmentReason']);
  if (amendmentReason != null) {
    emergencyRecordEntity.amendmentReason = amendmentReason;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyRecordEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyRecordEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyRecordEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyRecordEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyRecordEntity.deleted = deleted;
  }
  final String? emergencyId = jsonConvert.convert<String>(json['emergencyId']);
  if (emergencyId != null) {
    emergencyRecordEntity.emergencyId = emergencyId;
  }
  final List<String>? emergencyIdList = (json['emergencyIdList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (emergencyIdList != null) {
    emergencyRecordEntity.emergencyIdList = emergencyIdList;
  }
  final String? estimateDate = jsonConvert.convert<String>(json['estimateDate']);
  if (estimateDate != null) {
    emergencyRecordEntity.estimateDate = estimateDate;
  }
  final String? estimatePerson = jsonConvert.convert<String>(json['estimatePerson']);
  if (estimatePerson != null) {
    emergencyRecordEntity.estimatePerson = estimatePerson;
  }
  final String? estimateReportUrl = jsonConvert.convert<String>(json['estimateReportUrl']);
  if (estimateReportUrl != null) {
    emergencyRecordEntity.estimateReportUrl = estimateReportUrl;
  }
  final String? estimateResult = jsonConvert.convert<String>(json['estimateResult']);
  if (estimateResult != null) {
    emergencyRecordEntity.estimateResult = estimateResult;
  }
  final String? filingsDate = jsonConvert.convert<String>(json['filingsDate']);
  if (filingsDate != null) {
    emergencyRecordEntity.filingsDate = filingsDate;
  }
  final String? filingsDepartment = jsonConvert.convert<String>(json['filingsDepartment']);
  if (filingsDepartment != null) {
    emergencyRecordEntity.filingsDepartment = filingsDepartment;
  }
  final String? filingsDepartmentNature = jsonConvert.convert<String>(json['filingsDepartmentNature']);
  if (filingsDepartmentNature != null) {
    emergencyRecordEntity.filingsDepartmentNature = filingsDepartmentNature;
  }
  final String? filingsDepartmentNatureName = jsonConvert.convert<String>(json['filingsDepartmentNatureName']);
  if (filingsDepartmentNatureName != null) {
    emergencyRecordEntity.filingsDepartmentNatureName = filingsDepartmentNatureName;
  }
  final String? filingsName = jsonConvert.convert<String>(json['filingsName']);
  if (filingsName != null) {
    emergencyRecordEntity.filingsName = filingsName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyRecordEntity.id = id;
  }
  final String? planFilingApplyForUrl = jsonConvert.convert<String>(json['planFilingApplyForUrl']);
  if (planFilingApplyForUrl != null) {
    emergencyRecordEntity.planFilingApplyForUrl = planFilingApplyForUrl;
  }
  final String? planFilingFileUrl = jsonConvert.convert<String>(json['planFilingFileUrl']);
  if (planFilingFileUrl != null) {
    emergencyRecordEntity.planFilingFileUrl = planFilingFileUrl;
  }
  final int? recordType = jsonConvert.convert<int>(json['recordType']);
  if (recordType != null) {
    emergencyRecordEntity.recordType = recordType;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyRecordEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyRecordEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyRecordEntity.updateDate = updateDate;
  }
  final String? validPeriod = jsonConvert.convert<String>(json['validPeriod']);
  if (validPeriod != null) {
    emergencyRecordEntity.validPeriod = validPeriod;
  }
  final String? validPeriodName = jsonConvert.convert<String>(json['validPeriodName']);
  if (validPeriodName != null) {
    emergencyRecordEntity.validPeriodName = validPeriodName;
  }
  return emergencyRecordEntity;
}

Map<String, dynamic> $EmergencyRecordEntityToJson(EmergencyRecordEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['amendmentDate'] = entity.amendmentDate;
  data['amendmentInfo'] = entity.amendmentInfo;
  data['amendmentReason'] = entity.amendmentReason;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['emergencyId'] = entity.emergencyId;
  data['emergencyIdList'] = entity.emergencyIdList;
  data['estimateDate'] = entity.estimateDate;
  data['estimatePerson'] = entity.estimatePerson;
  data['estimateReportUrl'] = entity.estimateReportUrl;
  data['estimateResult'] = entity.estimateResult;
  data['filingsDate'] = entity.filingsDate;
  data['filingsDepartment'] = entity.filingsDepartment;
  data['filingsDepartmentNature'] = entity.filingsDepartmentNature;
  data['filingsDepartmentNatureName'] = entity.filingsDepartmentNatureName;
  data['filingsName'] = entity.filingsName;
  data['id'] = entity.id;
  data['planFilingApplyForUrl'] = entity.planFilingApplyForUrl;
  data['planFilingFileUrl'] = entity.planFilingFileUrl;
  data['recordType'] = entity.recordType;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['validPeriod'] = entity.validPeriod;
  data['validPeriodName'] = entity.validPeriodName;
  return data;
}

extension EmergencyRecordEntityExtension on EmergencyRecordEntity {
  EmergencyRecordEntity copyWith({
    String? amendmentDate,
    String? amendmentInfo,
    String? amendmentReason,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? emergencyId,
    List<String>? emergencyIdList,
    String? estimateDate,
    String? estimatePerson,
    String? estimateReportUrl,
    String? estimateResult,
    String? filingsDate,
    String? filingsDepartment,
    String? filingsDepartmentNature,
    String? filingsDepartmentNatureName,
    String? filingsName,
    String? id,
    String? planFilingApplyForUrl,
    String? planFilingFileUrl,
    int? recordType,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? validPeriod,
    String? validPeriodName,
  }) {
    return EmergencyRecordEntity()
      ..amendmentDate = amendmentDate ?? this.amendmentDate
      ..amendmentInfo = amendmentInfo ?? this.amendmentInfo
      ..amendmentReason = amendmentReason ?? this.amendmentReason
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..emergencyId = emergencyId ?? this.emergencyId
      ..emergencyIdList = emergencyIdList ?? this.emergencyIdList
      ..estimateDate = estimateDate ?? this.estimateDate
      ..estimatePerson = estimatePerson ?? this.estimatePerson
      ..estimateReportUrl = estimateReportUrl ?? this.estimateReportUrl
      ..estimateResult = estimateResult ?? this.estimateResult
      ..filingsDate = filingsDate ?? this.filingsDate
      ..filingsDepartment = filingsDepartment ?? this.filingsDepartment
      ..filingsDepartmentNature = filingsDepartmentNature ?? this.filingsDepartmentNature
      ..filingsDepartmentNatureName = filingsDepartmentNatureName ?? this.filingsDepartmentNatureName
      ..filingsName = filingsName ?? this.filingsName
      ..id = id ?? this.id
      ..planFilingApplyForUrl = planFilingApplyForUrl ?? this.planFilingApplyForUrl
      ..planFilingFileUrl = planFilingFileUrl ?? this.planFilingFileUrl
      ..recordType = recordType ?? this.recordType
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..validPeriod = validPeriod ?? this.validPeriod
      ..validPeriodName = validPeriodName ?? this.validPeriodName;
  }
}
